package com.nowcoder.community.entity;

import lombok.Data;

/**
 * @author cjh
 * @date 2023/1/13 - 11:12
 */
@Data
public class MyPage {
    Integer total;
    Integer current;
    Integer size;
    Integer pages;

    public Integer getPages() {
        if (getTotal() == 0) {
            return 0;
        }
        int pageNum = getTotal() / getSize();
        if (getTotal() % getSize() != 0) {
            pageNum++;
        }

        return pageNum;
    }
}
